﻿using UnityEngine;
using System.Collections;
using Dict.DataModel;


public class LevelupUnlockItem : MonoBehaviour
{
    public UILabel labTitle;
    public UILabel labInfo;
    public UILabel labStatus;
    public AloneTextureKit icon;

    public void SetUnlockItem(TableModule module, int curLevel)
    {
        if(curLevel < module.openLev)
        {
            labStatus.text = string.Format(TableTextBlo.GetText("unlock_at_x"), module.openLev);
            labStatus.effectColor = new Color(1, 1, 1);
            labStatus.color = new Color((float)38 / 255, (float)38 / 255, (float)38 / 255);
        }
        else
        {
            labStatus.text = TableTextBlo.GetText("unlocked");
            labStatus.effectColor = new Color((float)23 / 255, (float)62 / 255, 0);
            labStatus.color = new Color((float)128 / 255, 1, 0);
        }
        labTitle.text = TableTextBlo.GetText(module.modelName);
        labInfo.text = TableTextBlo.GetText(module.desc);
        icon.SetPath("LevelUpUnlockIcon/" + module.icon);
    }
}


